import React from 'react';
import { Router, Route } from 'dva/router';
import IndexPage from './routes/IndexPage';
import LoginPage from './routes/LoginPage';
import CategoryPage from './routes/CategoryPage'; // nopage
import CategoryDetailPage from './routes/CategoryDetailPage';
import SearchPage from './routes/SearchPage';
import ProductionPage from './routes/ProductionPage';
import ShopPage from './routes/ShopPage'; // nopage
import AddressPage from './routes/AddressPage';
import AddAddrPage from './routes/AddAddrPage';
import DeliverWayPage from './routes/DeliverWayPage';
import CashierPage from './routes/CashierPage';
import PayResultPage from './routes/PayResultPage';
import OrdersPage from './routes/OrdersPage';
import OrderPage from './routes/OrderPage'; // nopage
import OrderDetailPage from './routes/OrderDetailPage';
import MembersPage from './routes/MembersPage';
import MoreMembersPage from './routes/MoreMembersPage';
import MinePagePage from './routes/MinePagePage';

function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Route path="/" component={IndexPage} />
      <Route path="/login" component={LoginPage} />
      <Route path="/category" component={CategoryPage} />
      <Route path="/categoryDetail" component={CategoryDetailPage} />

      <Route path="/shop/:shopId" component={ShopPage} />
      
      <Route path="/production/detail" component={ProductionPage} >
        <Route path="/production/detail/:pid" component={ProductionPage} />
      </Route>
      <Route path="/search" component={SearchPage} >
        <Route path="/search/:searchKey" component={SearchPage} />
      </Route>

      <Route path="/order/detail" component={OrderDetailPage} >
        <Route path="/order/detail/:orderId" component={OrderDetailPage} />
      </Route>
      
      <Route path="/order" component={OrderPage} />
      <Route path="/address" component={AddressPage} />
      <Route path="/addAddr" component={AddAddrPage} />
      <Route path="/deliverWay" component={DeliverWayPage} />
      <Route path="/cashier" component={CashierPage} />
      <Route path="/payresult" component={PayResultPage} />
      <Route path="/orders" component={OrdersPage} />
      <Route path="/members" component={MembersPage} />
      <Route path="/mine-page" component={MinePagePage} />
      <Route path="/moreMembers" component={MoreMembersPage} />
    </Router>
  );
}
export default RouterConfig;